package com.bandi.tharshesnows.model;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Skirun or piste.
 * 
 * @author BND
 * 
 */
public class Skirun extends PersistentModel {

  private Resort resort;

  private String meteoURL;

  private String schedule;

  private String name;

  private SkirunStatus skirunStatus = SkirunStatus.CLOSED;

  private double snowHeight;

  private Date updated;

  private SkirunDifficulty difficulty = SkirunDifficulty.UNKNOWN;

  private double length; // meters

  private double startingAltitude;// meters

  private double destinationAltitude;// meters

  private double inclination;// dgrees

  private double width;// meters

  private Map<SkiTransport, Integer> skiTransports = new HashMap<SkiTransport, Integer>();

  private String remoteURL;

  private boolean canons;

  private boolean nightmode;

  private Location location;

  private List<Picture> pictures;

  private boolean starred;

  private boolean downloaded;

  private String observations;

  public String getObservations() {
    return observations;
  }

  public void setObservations(String observations) {
    this.observations = observations;
  }

  public boolean isDownloaded() {
    return downloaded;
  }

  public void setDownloaded(boolean downloaded) {
    this.downloaded = downloaded;
  }

  public boolean isOpen() {
    return skirunStatus.equals(SkirunStatus.OPEN) || skirunStatus.equals(SkirunStatus.OPEN_DIFFICULT)
        || skirunStatus.equals(SkirunStatus.OPEN_ACCEPTABLE) || skirunStatus.equals(SkirunStatus.OPEN_GOOD)
        || skirunStatus.equals(SkirunStatus.OPEN_OPTIMAL);
  }

  public Skirun(Resort resort) {
    super();
    this.resort = resort;
  }

  public boolean isStarred() {
    return starred;
  }

  public void setStarred(boolean starred) {
    this.starred = starred;
  }

  public List<Picture> getPictures() {
    return pictures;
  }

  public void setPictures(List<Picture> pictures) {
    this.pictures = pictures;
  }

  public String getMeteoURL() {
    return meteoURL;
  }

  public void setMeteoURL(String meteoURL) {
    this.meteoURL = meteoURL;
  }

  public String getSchedule() {
    return schedule;
  }

  public void setSchedule(String schedule) {
    this.schedule = schedule;
  }

  public Resort getResort() {
    return resort;
  }

  public Location getLocation() {
    return location;
  }

  public void setLocation(Location location) {
    this.location = location;
  }

  public boolean hasCanons() {
    return canons;
  }

  public void setCanons(boolean canons) {
    this.canons = canons;
  }

  public boolean isNightmode() {
    return nightmode;
  }

  public void setNightmode(boolean nightmode) {
    this.nightmode = nightmode;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getRemoteURL() {
    return remoteURL;
  }

  public void setRemoteURL(String remoteURL) {
    this.remoteURL = remoteURL;
  }

  public SkirunStatus getSkirunStatus() {
    return skirunStatus;
  }

  public void setSkirunStatus(SkirunStatus skirunStatus) {
    this.skirunStatus = skirunStatus;
  }

  public double getSnowHeight() {
    return snowHeight;
  }

  public void setSnowHeight(double snowHeight) {
    this.snowHeight = snowHeight;
  }

  public Date getUpdated() {
    return updated;
  }

  public void setUpdated(Date updated) {
    this.updated = updated;
  }

  public SkirunDifficulty getDifficulty() {
    return difficulty;
  }

  public void setDifficulty(SkirunDifficulty difficulty) {
    this.difficulty = difficulty;
  }

  public double getLength() {
    return length;
  }

  public void setLength(double length) {
    this.length = length;
  }

  public double getStartingAltitude() {
    return startingAltitude;
  }

  public void setStartingAltitude(double startingAltitude) {
    this.startingAltitude = startingAltitude;
  }

  public double getDestinationAltitude() {
    return destinationAltitude;
  }

  public void setDestinationAltitude(double destinationAltitude) {
    this.destinationAltitude = destinationAltitude;
  }

  public double getInclination() {
    return inclination;
  }

  public void setInclination(double inclination) {
    this.inclination = inclination;
  }

  public double getWidth() {
    return width;
  }

  public void setWidth(double width) {
    this.width = width;
  }

  public Map<SkiTransport, Integer> getSkiTransports() {
    return skiTransports;
  }

  public void setSkiTransports(Map<SkiTransport, Integer> skiTransports) {
    this.skiTransports = skiTransports;
  }

  @Override
  public String toString() {
    return "Skirun [name=" + name + ", skirunStatus=" + skirunStatus + ", snowHeight=" + snowHeight + ", updated="
        + updated + ", difficulty=" + difficulty + ", length=" + length + ", startingAltitude=" + startingAltitude
        + ", destinationAltitude=" + destinationAltitude + ", inclination=" + inclination + ", width=" + width
        + ", skiTransports=" + skiTransports + ", remoteURL=" + remoteURL + ", canons=" + canons + ", nightmode="
        + nightmode + "]";
  }

}
